package com.zzptc.zzsgz.bdsjws.fragments;



import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.zzptc.zzsgz.bdsjws.Adapter.ContactAdapter;
import com.zzptc.zzsgz.bdsjws.MyApplication;
import com.zzptc.zzsgz.bdsjws.R;
import com.zzptc.zzsgz.bdsjws.vo.Contact;
import com.zzptc.zzsgz.bdsjws.fragments.base.BaseFragmentbase;
import com.zzptc.zzsgz.bdsjws.utils.MyUtil;

import java.util.List;

import butterknife.BindView;


public class ShowAllContactFragment extends BaseFragmentbase {
    List<Contact> list;
    @BindView(R.id.rv_show_contact)
    RecyclerView rvShowContact;


    @Override
    public int getXML() {
        return R.layout.show_all_contact_fragment;
    }

    @Override
    public void initView() {

    }

    @Override
    public void initDate() {
        //得到数据
//         new Thread(new Runnable() {
//            @Override
//            public void run() {
//                list = MyUtil.getAllContacts();
//            }
//        }).start();
        list = MyApplication.getList();


        //写适配器类
        ContactAdapter contactAdapter = new ContactAdapter(list);

        //布局管理者
        rvShowContact.setLayoutManager(new LinearLayoutManager(getActivity()));
        rvShowContact.setAdapter(contactAdapter);
    }


}
